package com.dongfanggroup.report.service.impl;

import com.dongfanggroup.report.domain.ReportTransferHistory;
import com.dongfanggroup.report.mapper.ReportTransferHistoryMapper;
import com.dongfanggroup.report.service.IReportTransferHistoryService;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 报障单处理人转移Service业务层处理
 * 
 * @author wangsr
 * @date 2021-12-20
 */
@Service
public class ReportTransferHistoryServiceImpl implements IReportTransferHistoryService 
{
    @Autowired
    private ReportTransferHistoryMapper reportTransferHistoryMapper;

    /**
     * 查询报障单处理人转移
     * 
     * @param id 报障单处理人转移主键
     * @return 报障单处理人转移
     */
    @Override
    public ReportTransferHistory selectReportTransferHistoryById(Long id)
    {
        return reportTransferHistoryMapper.selectReportTransferHistoryById(id);
    }

    /**
     * 查询报障单处理人转移列表
     * 
     * @param reportTransferHistory 报障单处理人转移
     * @return 报障单处理人转移
     */
    @Override
    public List<ReportTransferHistory> selectReportTransferHistoryList(ReportTransferHistory reportTransferHistory)
    {
        return reportTransferHistoryMapper.selectReportTransferHistoryList(reportTransferHistory);
    }

    /**
     * 新增报障单处理人转移
     * 
     * @param reportTransferHistory 报障单处理人转移
     * @return 结果
     */
    @Override
    public int insertReportTransferHistory(ReportTransferHistory reportTransferHistory)
    {
        reportTransferHistory.setCreateTime(DateUtils.getNowDate());
        return reportTransferHistoryMapper.insertReportTransferHistory(reportTransferHistory);
    }

    /**
     * 修改报障单处理人转移
     * 
     * @param reportTransferHistory 报障单处理人转移
     * @return 结果
     */
    @Override
    public int updateReportTransferHistory(ReportTransferHistory reportTransferHistory)
    {
        return reportTransferHistoryMapper.updateReportTransferHistory(reportTransferHistory);
    }

    /**
     * 批量删除报障单处理人转移
     * 
     * @param ids 需要删除的报障单处理人转移主键
     * @return 结果
     */
    @Override
    public int deleteReportTransferHistoryByIds(Long[] ids)
    {
        return reportTransferHistoryMapper.deleteReportTransferHistoryByIds(ids);
    }

    /**
     * 删除报障单处理人转移信息
     * 
     * @param id 报障单处理人转移主键
     * @return 结果
     */
    @Override
    public int deleteReportTransferHistoryById(Long id)
    {
        return reportTransferHistoryMapper.deleteReportTransferHistoryById(id);
    }
}
